package com.lslx.ln.sample.annotation.provider;

import com.lslx.ln.sample.DemoService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.rpc.RpcContext;

/**
 * <pre>
 *  TODO
 * </pre>
 *
 * @Author zhangj
 * @Date 2022/6/27 10:46
 */
@Slf4j
@DubboService
public class DemoServiceAnnoImpl implements DemoService {

    @Override
    public String sayHello(String name) {
        log.info("Hello " + name + ", request from consumer: " + RpcContext.getContext().getRemoteAddress());
        return "Hello " + name + ", response from provider: " + RpcContext.getContext().getLocalAddress();
    }
}
